Micron Document
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
| SparkN0de-git | SparkN0de |
--------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------


Commit 7066b4de6f2cb323fa35d0aecb90ed8fbe616932


Parents : 6b815c4
Author : Mark Qvist <mark@unsigned.io>
Date : 2025-01-15T21:09:30+01:00

Fixed single-byte configuration changes not working on nRF

Changes

1 files changed, 1 insertions(+), 14 deletions(-)

M Utilities.h +1 -14

Diff

diff --git a/Utilities.h b/Utilities.h
index 49efeda..e08461f 100644
--- a/Utilities.h
+++ b/Utilities.h
@@ -1396,7 +1396,6 @@ void kiss_dump_eeprom() {
#if !HAS_EEPROM && MCU_VARIANT == MCU_NRF52
void eeprom_flush() {
- // sync file contents to flash
file.close();
file.open(EEPROM_FILE, FILE_O_WRITE);
written_bytes = 0;
@@ -1423,19 +1422,7 @@ void eeprom_update(int mapped_addr, uint8_t byte) {
file.write(byte);
}
written_bytes++;
-
- if ((mapped_addr - eeprom_addr(0)) == ADDR_INFO_LOCK) {
- #if !HAS_EEPROM && MCU_VARIANT == MCU_NRF52
- // have to do a flush because we're only writing 1 byte and it syncs after 4
- eeprom_flush();
- #endif
- }
-
- if (written_bytes >= 4) {
- file.close();
- file.open(EEPROM_FILE, FILE_O_WRITE);
- written_bytes = 0;
- }
+ eeprom_flush();
#endif
}


──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────